namespace RequirementAndBug.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.REQUsers",
                c => new
                    {
                        UserID = c.Int(nullable: false, identity: true),
                        UserCode = c.String(nullable: false, maxLength: 30),
                        Password = c.String(nullable: false, maxLength: 50),
                        NickName = c.String(maxLength: 20),
                        Status = c.Int(),
                        CreateTime = c.DateTime(),
                    })
                .PrimaryKey(t => t.UserID);
            
            CreateTable(
                "dbo.REQRequirements",
                c => new
                    {
                        RequireID = c.Int(nullable: false, identity: true),
                        UserID = c.Int(nullable: false),
                        ProCategory = c.Int(nullable: false),
                        Title = c.String(maxLength: 30),
                        ProjectDesc = c.String(maxLength: 3000),
                        ProjectType = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false),
                        ParentID = c.Int(),
                        Status = c.Int(nullable: false),
                        TargetUserID = c.Int(nullable: false),
                        IsTop = c.Int(),
                        UpdateTime = c.DateTime(),
                        FinishTime = c.DateTime(),
                        RankSign = c.Int(),
                        EstimateLength = c.Decimal(precision: 18, scale: 2),
                        DeadlineTime = c.DateTime(),
                        ClientType = c.Int(),
                    })
                .PrimaryKey(t => t.RequireID);
            
            CreateTable(
                "dbo.REQRoles",
                c => new
                    {
                        RoleID = c.Int(nullable: false, identity: true),
                        RoleName = c.String(),
                        Status = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.RoleID);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.REQRoles");
            DropTable("dbo.REQRequirements");
            DropTable("dbo.REQUsers");
        }
    }
}
